1. Field of the Invention
The invention relates to color conversion of display devices, and more particularly, to an apparatus for converting a first color in a first color space to a second color in a second color space and a method thereof.
2. Description of the Prior Art
Graphic systems convert image signals into a visible form and vice versa. Examples of common graphic systems include: cathode-ray tube (CRT) monitors, liquid crystal display (LCD) monitors, projection displays, digital cameras, scanners, camcorders, printers, etc. Different graphic systems have different image signal requirements meaning that the image signals for a particular graphic system are not necessarily compatible with other graphic systems. For example, the image signal format used in a digital overhead projector is not the same image signal format used in a printer. Even among graphic systems that both use RGB image signals, such as two LCD monitors, because each monitor has different display characteristics, the image signals producing a particular color on one monitor do not necessarily produce the identical color on another monitor. The particular display characteristics for a graphic system are also referred to as the device color space. Difficulties arise when trying to accurately reproduce color across open systems having different devices using different color spaces. Particularly with the advent of the Internet, it is imperative that all graphic systems exchange color information accurately and easily.
The International Color Consortium (ICC) has proposed a solution to the problem of communicating color in open systems, which involves attaching a profile for the input color space to the image file in question. This is appropriate for high end users but there are a broad range of users that do not require this level of flexibility and control. Additionally, most existing file formats do not support color profile embedding and, in fact, there are many applications that oppose appending any extra data to data files.
The standard default RGB color space (sRGB) developed by Hewlett-Packard and Microsoft provides a single RGB representation of color independent of the graphic system and has been standardized by the International Electrotechnical Commission (IEC) as IEC 61966-2-1. When using the sRGB specification, RGB values in the sRGB color space must be mapped to a corresponding RGB value in the destination color space and vice versa. Performing a mapping involves executing a matrix multiplication to adjust a first color value in the first color space to a second color in a second color space.
FIG. 1 shows the sRGB conversion formula 10 for mapping an sRGB value (R, G, B) to a destination dependent color space value (R′,G′, B′) according to the sRGB specification. As shown in FIG. 1, the second red value R′ is formed using a portion of the first red value R, the first green value G, and the first blue value B depending on the adjustment coefficients r1, g1, and b1 respectively. Similarly, the second green value G′ and the second blue value B′ are both formed using a portion of the first red value R, the first green value G and the first blue value B. The sRGB values are stored as 8 bit integers and the adjustments coefficients are stored as 10-bit floating-point values. Using standard matrix multiplication, the following formulas for the R′, G′, and B′ values are derived:R′=(R*r1+G*g1+B*b1)G′=(R*r2+G*g2+B*b2)B′=(R*r3+G*g3+B*b3)
To calculate the second red value R′, the first RGB values are first converted to floating-point values:Rfloat=R/255.0Gfloat=G/255.0Bfloat=B/255.0
A multiplier then multiplies the Rfloat, Gfloat, and Bfloat with the first red adjustment coefficient r1, the first green adjustment coefficient g1, and the first blue adjustment coefficient b1 respectively and adds the multiplication results together. The second floating-point red value is then converted back to an 8-bit integer and similar procedures are followed for the G′ and the B′ values. The following formulas show the full process and can be computed concurrently if sufficient hardware resources are available:R′=round(255.0*[r1*Rfloat+g1*Gfloat+b1*Bfloat])G′=round(255.0*[r2*Rfloat+g2*Gfloat+b2*Bfloat])B′=round(255.0*[r3*Rfloat+g3*Gfloat+b3*Bfloat])
In today's competitive consumer electronic marketplace, the performance of graphic systems must be as high as possible while keeping the price as low as possible. In other words, the conversion from a first color space to a second color space needs to be executed as fast as possible and with minimal hardware requirements. However, the conversions from integer to floating point, the conversions from floating point to integer, and the multiplications all require non-trivial processing time and specialized hardware. An efficient and cost effective implementation is needed.